/*
 * File Name     : @(#)ISearchDTO.java
 * Creation Date : Mar 2, 2009
 * Author        : anirudh
 * 
 * Copyright 2009 Anirudh Vyas
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package hcis.dto.search;

import hcis.core.engine.event.IEvent;
import hcis.dto.IDTO;
import hcis.dto.cache.search.ISearchCache;
import hcis.dto.list.IListDTO;
import hcis.model.IModel;
import hcis.model.annotation.HCISEntity;

import java.io.Serializable;
import java.util.Collection;

/**
 * A search DTO is essentially a list DTO capable of holding information related to; <br />
 * <ul>
 * <li>Search Criteria</li>
 * <li>Search results</li>
 * <li>Pagination</li>
 * </ul>
 * 
 * @author avyas
 * @param <EVENT>
 * @param <SOURCE>
 * @param <CRITERIA>
 *            criteria type.
 * @param <RESULT>
 *            result type.
 * @param <MODEL>
 *            model type.
 * @param <MODELID>
 *            model id type.
 */
@HCISEntity
public interface ISearchDTO<EVENT extends IEvent<SOURCE, MODEL, MODELID>, SOURCE extends IDTO<MODEL, MODELID>, CRITERIA extends Serializable, RESULT extends Collection<MODEL>, MODEL extends IModel<MODELID>, MODELID extends Serializable>
		extends IListDTO<RESULT, MODEL, MODELID> {

	/**
	 * Gets the search criteria.
	 * 
	 * @return search criteria to get.
	 */
	public abstract CRITERIA getSearchCriteria();

	/**
	 * Sets the search criteria.
	 * 
	 * @param pCriteria
	 *            search criteria to set.
	 */
	public abstract void setSearchCriteria(final CRITERIA pCriteria);

	/**
	 * Sets the search results.
	 * 
	 * @param pResult
	 *            search results to set.
	 */
	public abstract void setSearchResult(final RESULT pResult);

	/**
	 * Gets the search result.
	 * 
	 * @return search results to get.
	 */
	public abstract RESULT getSearchResult();

	/**
	 * Gets the page count.
	 * 
	 * @return page count to get.
	 */
	public abstract Integer getPageCount();

	/**
	 * Sets the page count.
	 * 
	 * @param pPageCount
	 *            page count to set.
	 */
	public abstract void setPageCount(final Integer pPageCount);

	/**
	 * Gets the search cache.
	 * 
	 * @return search cache to get.
	 */
	public abstract ISearchCache<EVENT, SOURCE, RESULT, MODEL, MODELID> getSearchCache();

	/**
	 * Sets the search cache.
	 * 
	 * @param pSearchCache
	 *            search cache to set.
	 */
	public abstract void setSearchCache(final ISearchCache<EVENT, SOURCE, RESULT, MODEL, MODELID> pSearchCache);
}
